package com.leyou.common.vo;

import com.leyou.common.exceptions.LyException;
import lombok.Getter;
import org.joda.time.DateTime;

/**
 * @author xiuer
 * @version V1.0.0
 * @package com.leyou.common.vo
 * @description 异常结果对象，封装异常的参数status：状态码  message：异常信息 timestamp：异常发生的时间
 * @date 2019/6/22 19:32
 */
@Getter
public class ExceptionResult {
    private int status;
    private String message;
    private String timestamp;


    public ExceptionResult(LyException e) {
        this.status = e.getStatus();
        this.message = e.getMessage();
        this.timestamp = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
    }
}
